/*
 * $Copyright
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright 2009-2010
 *    Softperience Ltd. and/or
 *    Radosław Smogura
 * All rights reserved.
 *
 * The content of this file is confidential and it is intelectual property
 * of copyright owners.
 *
 * You cannot copy, redistribute, distribute, view, modify as a part or as whole
 * this file and its content in any form including coping on electronic devices,
 * publishing on web pages or paper, printing without writen permision of
 * copyright owners
 *
 * This file is protected by Polish and / or international law.
 * $
 *
 * $URL: http://reprap-ide.googlecode.com/svn/trunk/RepRapIDE/Machines/src/main/java/eu/softper/reprap/machines/ExplorerTopComponent.java $
 * $Id: ExplorerTopComponent.java 3 2012-11-19 10:58:30Z mail@smogura.eu $
 * $Revision: 3 $
 */
package eu.softper.reprap.machines;

import org.netbeans.api.settings.ConvertAsProperties;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.explorer.view.BeanTreeView;
import org.openide.windows.TopComponent;
import org.openide.util.NbBundle.Messages;

/**
 * Top component which displays something.
 */
@ConvertAsProperties(dtd = "-//eu.softper.reprap.machines//Explorer//EN",
autostore = false)
@TopComponent.Description(preferredID = "ExplorerTopComponent",
//iconBase="SET/PATH/TO/ICON/HERE", 
persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = "explorer", openAtStartup = true)
@ActionID(category = "Window", id = "eu.softper.reprap.machines.ExplorerTopComponent")
@ActionReference(path = "Menu/Window" /*
 * , position = 333
 */)
@TopComponent.OpenActionRegistration(displayName = "#CTL_ExplorerAction",
preferredID = "ExplorerTopComponent")
@Messages({
    "CTL_ExplorerAction=Machines",
    "CTL_ExplorerTopComponent=Machines",
    "HINT_ExplorerTopComponent=Shows defined 3D machines"
})
public final class ExplorerTopComponent extends TopComponent {
    private BeanTreeView beanTreeView;
    
    public ExplorerTopComponent() {
        initComponents();
        setName(Bundle.CTL_ExplorerTopComponent());
        setToolTipText(Bundle.HINT_ExplorerTopComponent());
        beanTreeView = new BeanTreeView();
        add(beanTreeView);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setLayout(new java.awt.BorderLayout());
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
    @Override
    public void componentOpened() {
        // TODO add custom code on component opening
    }

    @Override
    public void componentClosed() {
        // TODO add custom code on component closing
    }

    void writeProperties(java.util.Properties p) {
        // better to version settings since initial version as advocated at
        // http://wiki.apidesign.org/wiki/PropertyFiles
        p.setProperty("version", "1.0");
        // TODO store your settings
    }

    void readProperties(java.util.Properties p) {
        String version = p.getProperty("version");
        // TODO read your settings according to their version
    }
}
